var util = require('util');

function Base() {
    this.name = 'base';
    this.base = 1991;
    this.sayHello = function() {
        console.log('Hello ' + this.name);
    };
}
Base.prototype.showName = function() {
    console.log(this.name);
};

function Sub() {
    this.name = 'sub';
}
util.inherits(Sub, Base);
console.log('---------Sub------------')
console.log(Sub)
var objBase = new Base();
console.log('---------showName------------')
objBase.showName();
console.log('----------sayHello-----------')
objBase.sayHello();
console.log('---------objBase------------')
console.log(objBase);
var objSub = new Sub();
console.log('---------showName------------')
objSub.showName(); //super function
//objSub.sayHello();      //
console.log(objSub);
console.log('---------inspect------------')
console.log(util.inspect(objBase));
console.log(util.inspect(objBase, true));